UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NwJqmMOauUVatEUrcVozHFRO4BxhsY2h4SYmMLLqVgc='
WHERE
key_id = '19f6f26673992e44fdbb5ac21ca88007afc94b8b35bb9541346d4447da773979'
AND (
token = 'NwJqmMOauUVatEUrcVozHFRO4BxhsY2h4SYmMLLqVgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)