UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S35gK87lXWovu4Aazmt3ZhjBoIIZR2aWcLY0uPxkCQ0='
WHERE
key_id = 'eddb7f7911311635734080175ed205a6b790930e52793d8b3fcf55c8fcb11cdf'
AND (
token = 'S35gK87lXWovu4Aazmt3ZhjBoIIZR2aWcLY0uPxkCQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)