UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a46o3K8N4QaxqolTibjjvf7+kccr78A4AKhthQqNLWQ='
WHERE
key_id = 'a027d7a989e2d52c3160759558a7a55291f1587d4dade866c0ca7abc52e124b0'
AND (
token = 'a46o3K8N4QaxqolTibjjvf7+kccr78A4AKhthQqNLWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)