UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ogr29CqGnLSUyIlBI8hNN9v4MAvQ4K0P7kPtTRAGPRM='
WHERE
key_id = 'aabd3ca1a587378cc5f1f25b62442194542342032fad533b02402c840e5fa524'
AND (
token = 'Ogr29CqGnLSUyIlBI8hNN9v4MAvQ4K0P7kPtTRAGPRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)