UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+bVe9A/6W2AV1gRF+fsqzue6ADPN+2xeS+WX7OIafp0='
WHERE
key_id = 'a386bb5ed16875ef039bd915413d73a78b71f474d9f56978f56fa11bd4fd6ab7'
AND (
token = '+bVe9A/6W2AV1gRF+fsqzue6ADPN+2xeS+WX7OIafp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)