UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B5yq4O13CWBx4Ne68ztje458q8/QsOhIHNO9M3WWtas='
WHERE
key_id = '8832b0d197f38f435a03f750d04d9ecb6f825834c882047d2762aa6973b162ea'
AND (
token = 'B5yq4O13CWBx4Ne68ztje458q8/QsOhIHNO9M3WWtas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)