UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0B2H3xkCJL6D6XvdizXlcr8PDr+8/vGJPOvDkQDI0N0='
WHERE
key_id = '3831f533a42aa73f451ffd08adcfe8a9f8da4d423f8c4dd660601a19bc5541a2'
AND (
token = '0B2H3xkCJL6D6XvdizXlcr8PDr+8/vGJPOvDkQDI0N0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)