UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YSXRB4tQSHAcUabr48htA2Rla3qCmMJb80WjX/vJl8A='
WHERE
key_id = '6f4a7b9dcbf526fcd7b903c58901dbffc143e0d90bac4a8069b6a40c4a88c6eb'
AND (
token = 'YSXRB4tQSHAcUabr48htA2Rla3qCmMJb80WjX/vJl8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)