UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NYh9riN9loVLR1x2imThq9RMK+Bw/CxqDyGl39bqnHg='
WHERE
key_id = '5a99b427de521f02c6e76ed8821f17d06ac4f089ec0b7163c3ceae6ad0e0c03f'
AND (
token = 'NYh9riN9loVLR1x2imThq9RMK+Bw/CxqDyGl39bqnHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)