UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8QRXk0ToD513suRR5nk91Mr/F7Tftd/hXLnjQ5ERiC0=' 
WHERE 
  key_id = '3b6a9f83940ca0bfe57f51b9f4d8486601a48f46c704b8903ad6c8cf106bbbc2' 
  AND (
    token = '8QRXk0ToD513suRR5nk91Mr/F7Tftd/hXLnjQ5ERiC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050