UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcksUNz8Nl4M+nQDZcnS/n9s7MjYXdL1SBVdhhc+PkA='
WHERE
key_id = 'd553a448a06af861a422265f1671e5ea83dbbd1bd3e8313a699e10841011e328'
AND (
token = 'gcksUNz8Nl4M+nQDZcnS/n9s7MjYXdL1SBVdhhc+PkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)