UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxaAixyp0QgHHeOnPJUCUT3Dlj8/6oMHLlh10ZzbqfQ='
WHERE
key_id = '574d69371516a92f4d46c81703f5adfa3ac943ab772acc61794f419649683b2a'
AND (
token = 'bxaAixyp0QgHHeOnPJUCUT3Dlj8/6oMHLlh10ZzbqfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)