UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k+U6h6cjln9r4Y0bT37On/uCNY5ZWsnElFsiCx2+Y1c='
WHERE
key_id = '34a5ceb8f314db2506c084b165b4c7c75606e3f3db4ad0123d2380f0b48af98f'
AND (
token = 'k+U6h6cjln9r4Y0bT37On/uCNY5ZWsnElFsiCx2+Y1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)