UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bwu+DO/TBKSW55kXmLeIxlUo88unaaMfjWXzKuo7rA='
WHERE
key_id = 'b9d45066eb5ec3a16bdba1cba742884a787ffdcd600c178b2a28107133a41535'
AND (
token = '/bwu+DO/TBKSW55kXmLeIxlUo88unaaMfjWXzKuo7rA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)