UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rf/pVaitrm+MBgPXh4cqyqtjs+INCFs4YE+sBIDONu4=' 
WHERE 
  key_id = '3ea92e6a82f3c84030ebfee1e419761f86c8c6687d2aa948df28b217560a96b2' 
  AND (
    token = 'rf/pVaitrm+MBgPXh4cqyqtjs+INCFs4YE+sBIDONu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030